from django.db import models

# Create your models here.
class Depart(models.Model):
    '''
    deparement
    '''
    title=models.CharField(verbose_name='部门名称',max_length=120)

    def __str__(self):
        return self.title

    class Meta:
        verbose_name_plural = verbose_name = '部门'


class UserInfo(models.Model):
    """
    用户表
    """
    gender_choides= (
        (1,'男'),
        (2,'女')
    )
    name=models.CharField(verbose_name='姓名',max_length=32)
    gender = models.IntegerField(verbose_name='性别',choices=gender_choides,default=1)
    age=models.CharField(verbose_name='年龄',max_length=32)
    email=models.CharField(verbose_name='邮箱',max_length=32)
    depart=models.ForeignKey(verbose_name='部门',to="Depart",on_delete=models.SET_NULL,
                             null=True,blank=True)

    def __str__(self):
        return self.name

